{*
SPDX-FileCopyrightText: © 2023 Olivier Meunier <olivier@neokraft.net>

SPDX-License-Identifier: AGPL-3.0-only
*}
{{ extends "./base" }}

{{ block title() }}About Readeck{{ end }}

{{ block mainContent() }}
<div class="max-w-3xl">
  <div class="text-center my-4">
    <h1 class="title text-h1">About Readeck</h1>

      <p class="my-1"><strong>Version:</strong><br> {{ .Version }}</p>
      <p class="my-1"><strong>Built on:</strong><br> {{ date(.BuildTime, "Monday, 2 January 2006 15:04:05 MST") }}</p>
  </div>

  <h2 class="title text-h2">System Information</h2>

  <p>Here are your current system information. Please include them if you report a bug.</p>

  <ul class="my-4 p-2 text-sm font-mono bg-gray-100 border border-gray-200 rounded">
    <li>Version: {{ .Version }}</li>
    <li>Build Date: {{ .BuildTime }}</li>
    <li>Platform: {{ .OS }} / {{ .Arch }}</li>
    <li>Go Version: {{ .GoVersion }}</li>
    <li>Database Connector: {{ .DBConnecter }}</li>
  </ul>

  <h2 class="title text-h2">License</h2>

  <p>Readeck is distributed under the terms of the
  <a href="https://www.gnu.org/licenses/agpl-3.0.html" class="link">GNU Affero General Public License v3.0</a>.
  Here's a short summary of the license conditions:</p>

  <table class="my-4 w-full table-fixed">
    <thead>
      <tr>
        <th class="text-left">Permissions</th>
        <th class="text-left">Conditions</th>
        <th class="text-left">Limitations</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="align-baseline">
          <ul>
            <li title="The licensed material and derivatives may be used for commercial purposes.">
              {{ yield icon(name="o-circle", class="svgicon text-green-700") }} Commercial use
            </li>
            <li title="The licensed material may be distributed.">
              {{ yield icon(name="o-circle", class="svgicon text-green-700") }} Distribution
            </li>
            <li title="The licensed material may be modified.">
              {{ yield icon(name="o-circle", class="svgicon text-green-700") }} Modification
            </li>
            <li title="This license provides an express grant of patent rights from contributors.">
              {{ yield icon(name="o-circle", class="svgicon text-green-700") }} Patent use
            </li>
            <li title="The licensed material may be used and modified in private.">
              {{ yield icon(name="o-circle", class="svgicon text-green-700") }} Private use
            </li>
          </ul>
        </td>
        <td class="align-baseline">
          <ul>
            <li title="Source code must be made available when the licensed material is distributed.">
              {{ yield icon(name="o-circle", class="svgicon text-blue-700") }} Disclose source
            </li>
            <li title="A copy of the license and copyright notice must be included with the licensed material.">
              {{ yield icon(name="o-circle", class="svgicon text-blue-700") }} License and copyright notice
            </li>
            <li title="Users who interact with the licensed material via network are given the right to receive a copy of the source code.">
              {{ yield icon(name="o-circle", class="svgicon text-blue-700") }} Network use is distribution
            </li>
            <li title="Modifications must be released under the same license when distributing the licensed material. In some cases a similar or related license may be used.">
              {{ yield icon(name="o-circle", class="svgicon text-blue-700") }} Same license
            </li>
            <li title="Changes made to the licensed material must be documented.">
              {{ yield icon(name="o-circle", class="svgicon text-blue-700") }} State changes
            </li>
          </ul>
        </td>
        <td class="align-baseline">
          <ul>
            <li title="This license includes a limitation of liability.">
              {{ yield icon(name="o-circle", class="svgicon text-red-700") }} Liability
            </li>
            <li title="This license explicitly states that it does NOT provide any warranty.">
              {{ yield icon(name="o-circle", class="svgicon text-red-700") }} Warranty
            </li>
          </ul>
        </td>
      </tr>
    </tbody>
  </table>

  <div class="my-4 prose border border-gray-200 bg-gray-100 rounded pt-4 px-4">
    <p>Readeck<br />
    Copyright &copy; 2020 Olivier Meunier<p>

    <p>This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published
    by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.</p>

    <p>This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.</p>

    <p>You should have received a copy of the GNU Affero General Public License
    along with this program.
    If not, see <a href="https://www.gnu.org/licenses/" class="link">https://www.gnu.org/licenses/</a></p>
  </div>

  <h2 class="title text-h2">Third-Party Licenses</h2>

  <p class="my-4">Readeck includes and/or uses the following open source assets:</p>

  {{- range .Licenses -}}
  <h3 class="font-bold mt-4 mb-2">{{ .Name }}</h3>
  <ul>
    <li title="Author" class="flex gap-2 mb-1">{{ yield icon(name="o-pen") }} {{ .Author }}</li>
    <li title="License" class="flex gap-2 mb-1">{{ yield icon(name="o-license") }}
      <a href="https://spdx.org/licenses/{{ .License }}.html" class="link" rel="nofollow noopener noreferrer">{{ .License }}</a>
    </li>
    <li title="URL" class="flex gap-2 mb-1">{{ yield icon(name="o-link") }}
      <a href="{{ .URL}}" class="link" rel="nofollow noopener noreferrer">{{ .URL }}</a>
    </li>
    <li title="Copyright" class="flex gap-2 mb-1">{{ yield icon(name="o-copyright") }} <pre class="text-sm">{{ .Copyright}}</pre></li>
  </ul>
  {{- end -}}
</div>
{{ end }}
